#include "udpServer.hpp"
#include <memory>
using namespace Server;

static void Useage(char *ret)
{
    printf("运行失败，请输入后面2个参数,端口，ip%s\n", ret);
}

//./udpServer port
int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        Useage(argv[0]);
        exit(3);
    }

    // string ip = argv[1];
    uint16_t port = atoi(argv[1]);

    unique_ptr<udpServer> ret(new udpServer(port));
    ret->initServer();
    ret->start();

    return 0;
}